package com.resou.reader.setting;

import android.content.Context;
import android.content.SharedPreferences;

import com.resou.reader.mine.IView.UserInstance;

/**
 * Created by ${Garrett} on 2018/11/2.
 * Contact me krouky@outlook.com
 */
class UserSettingSharedPref {

    private static SharedPreferences sharedPreferences(Context context) {
        return context.getSharedPreferences("user_info", Context.MODE_PRIVATE);
    }

    static boolean setPublicityBirthday(Context context, boolean isPublic) {
        return sharedPreferences(context).edit().putBoolean(UserInstance.getToken() + "publicity_birthday", isPublic).commit();
    }

    static boolean getPublicityBirthday(Context context) {
        return sharedPreferences(context).getBoolean(UserInstance.getToken() + "publicity_birthday", true);
    }
}
